<template>
    <div class="main-container">
        <navbar title="个人中心"></navbar>
        <!--页面主内容区开始-->
        <ul class="mui-table-view mui-table-view-chevron">
            <li class="mui-table-view-cell">
                <a id="rate" class="mui-navigate-right">个人资料</a>
            </li>
            <li class="mui-table-view-cell">
                <a id="share" class="mui-navigate-right">分享推荐</a>
            </li>
            <li class="mui-table-view-cell">
                <a id="tel" class="mui-navigate-right">客服电话</a>
            </li>
            <li class="mui-table-view-cell">
                <a id="feedback-btn" class="mui-navigate-right">问题反馈</a>
            </li>
        </ul>
        <ul class="mui-table-view mui-table-view-chevron">
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right">设置</a>
            </li>
        </ul>
        <ul class="mui-table-view">
            <li class="mui-table-view-cell" style="text-align: center;">
                <a id='exit' @click="exit">退出</a>
            </li>
        </ul>
        <!--页面主内容区结束-->
    </div>
</template>

<script>
    import NavBar from '../common/navbar.vue'
    export default {
        data(){
            return{
                userlogin: this.$store.getters.authorization
            }
        },
        created(){    
            if(this.userlogin){
                console.info('已登录：' + this.userlogin);
            }
            else{
                console.info('未登录：' + this.userlogin);
                this.$router.push({ name: 'login'});                
            }

        },
        methods:{
            //退出
            exit:function(){
                this.$store.commit('login',false);
                this.$router.push({ name: 'login'});
            }
        },
        components: {
            navbar: NavBar
        }
    }
</script>


<style lang="scss" scoped>
    .main-container {
        background-color: #efeff4;
        height: 100%;
    }

    .mui-table-view {
        margin-top: 20px;
    }
</style>